package com.xxzb.pack0823.线程同步.互斥同步;

public class PrintStrTest {

    public static void main(String[] args) {

        //创建PrintStr对象
        final PrintStr printStr = new PrintStr("ABCDEFGHIXYZ");
        final PrintStr printStr1 = new PrintStr("1234567890");

        new Thread(new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 10; i++) {
                    printStr.printStr();
                }

            }
        },"A").start();


        new Thread(new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 10; i++) {
                    printStr1.printStr();
                }
            }
        },"B").start();
    }
}
